import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document, ObjectId } from 'mongoose';
export type PhotosTypeDocument = PhotosType & Document;

@Schema()
export class PhotosType {
    _id: ObjectId;
    /**
     * 类型名
     */
    @Prop({
        index: true,
        unique: true,
        required: true,
    })
    title: string;
    /**
     * 描述
     */
    @Prop({
        default: '',
    })
    desc: string;
    /**
     * 排序
     */
    @Prop({
        default: 0,
    })
    orderIndex: number;
    /**
     * 创建时间
     */
    @Prop({
        default: Date.now,
    })
    createdAt: Date;
}

export const PhotosTypeSchema = SchemaFactory.createForClass(PhotosType);
